import dask
from dask.highlevelgraph import HighLevelGraph


def inc(x):
    return x + 1


def double(x):
    return x * 2


def add(x, y):
    return x + y


data = range(5)
output = []
for x in data:
    a = dask.delayed(inc)(x)
    b = dask.delayed(double)(x)
    c = dask.delayed(add)(a, b)
    output.append(c)
total = dask.delayed(sum)(output)
total.visualize()